home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-29 | 6.0 KB | 175 lines | [TEXT/MPS ] |
- //#define kDEBUG
-
- #ifdef kDEBUG
- #define TraceExecution(x) DebugStr(x)
- #else
- #define TraceExecution(x)
- #endif
-
- // constants --------------------------------------------------------------
-
- #define kAttrBufferSize 8192L
- #define kRecordBufferSize 8192L
- #define kIdentity 0
- #define kMSAMVersion 1L
- #define kTimeout (30*60)
- #define kStdSlotInfoVersion 1
-
- #define kInternalError -1
- #define kNoRecords -2
-
- // resource ids
-
- #define kOldPasswordItem 3
- #define kNewPasswordItem 4
- #define kPasswordDialog 128
- #define kNoPrevPassDialog 129
- #define kIncorrectPWAlert 130
-
- // attribute type names
-
- #define kSetupAttr ((AttributeTypePtr)"\0\0\0\23AOCE Internet Setup")
- #define kVersionAttribute (OCEGetIndAttributeType(kVersionAttrTypeNum))
-
- #define kOCESetupRecName ((RStringPtr)"\0\0\0\21\0OCE Setup Record")
-
- #define kMSAMRecordName ((RStringPtr)"\0\0\0\15Internet MSAM")
-
- #define kDirectoryName ((DirectoryName *)"\0\0\0\22Internet Directory")
- #define kDirNameLength 22
- #define kDirectoryComment ((RStringPtr)"\0\0\0\7comment")
- #define kCommentLength 11
- #define kDirectoryType ((RStringPtr)"\0\0\0\22aoce DirectoryInet")
- #define kDirTypeLength (18+4)
-
- #define kMailServiceName ((RStringPtr)"\0\0\0\20Internet Service")
- #define kMailServiceType ((RStringPtr)"\0\0\0\25aoce Mail ServiceInet")
-
- // other gateway specific defines
-
- #define kDirectoryOSType 'Inet'
-
- // states of template
-
- enum {
- kIdle,
- kDoingCreate,
- kDoingModify
- };
-
- // typedefs ---------------------------------------------------------------
-
- // gateway-specific slot information
-
- typedef struct SpecificSlotInfo {
- char popServer[64];
- char smtpServer[64];
- } SpecificSlotInfo;
-
-
- // external directory identity information
-
- typedef struct DirIdentity {
- char userName[64];
- char password[64];
- char oldPassword[64];
- } DirIdentity;
-
- // all configuration information read from or written to the info page
-
- typedef struct ConfigInformation {
- MailStandardSlotInfoAttribute stdInfo;
- SpecificSlotInfo specInfo;
- DirIdentity dirIdentity;
- } ConfigInformation;
-
- // global data block used across calls to external det code
-
- typedef struct GlobalData {
- ConfigInformation config;
- short oceSetupDSRef;
- CreationID directoryCID;
- CreationID mailCID;
- Boolean hasBeenCreated;
- Boolean fakeDirectory;
- } GlobalData;
-
- // convenience structure for password dialog
-
- typedef struct PasswordDialogData {
- char *oldPassword;
- char *password;
- } PasswordDialogData;
-
-
- // passed in the client data to lookup parse so we have a place to copy data
-
- typedef struct AttributeCopyInfo {
- Ptr buffer;
- Size bufferSize;
- CreationID *creationID;
- Boolean gotOne;
- } AttributeCopyInfo,*AttributeCopyInfoPtr;
-
- // passed into record parse
-
- typedef struct RecordCopyInfo {
- CreationID *creationID;
- Boolean gotOne;
- RStringPtr recordName;
- } RecordCopyInfo;
-
-
- // prototypes -------------------------------------------------------------
-
- pascal OSErr InternetMailServiceCode(DETCallBlockPtr callBlockPtr);
-
- OSErr InitTemplate(DETCallBlockPtr callBlockPtr);
- OSErr InitInstance(DETCallBlockPtr callBlockPtr);
- OSErr ExitInstance(DETCallBlockPtr callBlockPtr);
- OSErr ValidateSave(DETCallBlockPtr callBlockPtr);
- OSErr PropertyItemHit(DETCallBlockPtr callBlockPtr);
- OSErr UpdateDisplayNames(DETCallBlockPtr callBlockPtr,GlobalData *globalData);
-
- OSErr CheckFileIDs(DETCallBlockPtr callBlockPtr);
- OSErr GetMailSlotInfo(short dsRef,const CreationID *mailCID,ConfigInformation *config,Boolean *hasBeenCreated);
- OSErr GetDirectoryInfo(short dsRef,const CreationID *directoryCID,ConfigInformation *config,Boolean *directoryIsFake);
-
- OSErr SetInfoPageInformation(DETCallBlockPtr callBlockPtr,ConfigInformation *config);
- OSErr GetInfoPageInformation(DETCallBlockPtr callBlockPtr,ConfigInformation *config);
- Boolean HasBeenChanged(DETCallBlockPtr callBlockPtr,ConfigInformation *config);
-
- OSErr GetStringProperty(DETCallBlockPtr callBlockPtr, short property, RString *str);
- OSErr SetStringProperty(DETCallBlockPtr callBlockPtr, RString *string, short property);
- OSErr SetNumProperty(DETCallBlockPtr callBlockPtr, short property, long value);
- OSErr GetNumProperty(DETCallBlockPtr callBlockPtr, short property, long *value);
- OSErr DirtyProperty(DETCallBlockPtr callBlockPtr, short property);
- OSErr GetFileID(DETCallBlockPtr callBlockPtr,long *fileID);
- OSErr DoBusy(DETCallBlockPtr callBlockPtr);
- OSErr RequestSync(DETCallBlockPtr callBlockPtr);
-
- OSErr ModifyOurSlot(DETCallBlockPtr callBlockPtr,GlobalData *globalData);
- OSErr CreateOurSlot(DETCallBlockPtr callBlockPtr,GlobalData *globalData);
-
- OSErr ChangeSingleAttribute(const CreationID *cid,short dsRef,AttributeType *attribType,void *data,unsigned long dataLength,AttributeTag tag);
- OSErr DeleteAttributeType(const CreationID *cid,short dsRef,AttributeType *attribType);
- OSErr GetSingleValueAttribute(const CreationID *cid,short dsRef,AttributeType *attribType,void *attrBuffer,Size attrBufferSize,CreationID *retCID);
- pascal Boolean RecordIDCallback(long clientData, const RecordID *recordID);
- pascal Boolean SingleAttrValueCallback(long clientData, const Attribute *attribute);
- OSErr GetSingleRecord(short dsRef,RStringPtr recordType,RStringPtr recordName,CreationID *returnedCID);
- pascal Boolean GatewayDirEnumCallback(long clientData, const DirEnumSpec *enumSpec);
- OSErr AddAttribute(const CreationID *cid,short dsRef,AttributeType *attribType,void *data,unsigned long dataLength,AttributeTag tag);
- OSErr SetRecNameAndType(const CreationID *cid,short dsRef,RStringPtr newName,RStringPtr newType);
- OSErr AddRecord(short dsRefNum,RStringPtr recordName,RStringPtr recordType,CreationID *newCID);
- OSErr AddDirectoryIdentity(const CreationID *cid,char *userName,char *password);
- OSErr ChangeDirectoryIdentity(const CreationID *cid,char *userName,char *password,char *oldPassword);
- void MakePersonalRecordID(RecordID *recordID,const CreationID *creationID);
- void GetCreationIDFromDSSpec(const PackedDSSpec *dsSpec,CreationID *cid);
-
- OSErr SetUserPassword(char *passwordStorage);
- void ChangePassword(char *pwStorage);
- Boolean GetPasswordDialog(char *oldPassword,char *password,Boolean hasPassword);
- pascal Boolean PasswordFilter(DialogPtr theDialog,EventRecord *theEvent,short *itemHit);
-
- void DoError(OSErr err);
-